#ifndef INFINITY_WORLD_SECTOR_INL
#	define INFINITY_WORLD_SECTOR_INL

#include "planetcell.h"

namespace infinity {

inline WorldSector::WorldSector()
:	m_cells(NULL)
{
}

inline WorldSector::~WorldSector()
{
	delete [] m_cells;
}

/*static*/ inline Vector3i WorldSector::getSectorIdFromCell(const Vector3i& cellId)
{
	Vector3i sectorId;

	sectorId.x = cellId.x / WorldSector::SideCells - (cellId.x < 0 ? 1 : 0);
	sectorId.y = cellId.y / WorldSector::SideCells - (cellId.y < 0 ? 1 : 0);
	sectorId.z = cellId.z / WorldSector::SideCells - (cellId.z < 0 ? 1 : 0);

	return sectorId;
}

inline void WorldSector::setId(const Vector3i& id)
{
	m_id = id;
}

inline const Vector3i& WorldSector::getId() const
{
	return m_id;
}

} // namespace infinity

#endif // !INFINITY_WORLD_SECTOR_INL
